﻿@model CoreData.Product
@{ 
    ViewBag.Title = "Add or Update Special";
}
<div class="row-fluid">
    <div class="span12">
        <div class="head">
            <div class="isw-documents">
            </div>
            <h1>
                Detail</h1>
            <div class="clear">
            </div>
        </div>
        <div class="block-fluid tabs">
            <ul>
                <li><a href="#tabs-1">Content</a></li>
                <li><a href="#tabs-2">SEO Management</a></li>
            </ul>
            @using (Ajax.BeginForm("AddOrUpdate", "ProductManagement", new AjaxOptions { OnSuccess = "Success", HttpMethod = "Post" }, new { enctype = "multipart/form-data", @id = "validation" }))
            {
                <div class="warning-area">
                </div>
                <div id="tabs-1">
                    @Html.HiddenFor(x => x.ID)
                    <div class="row-form">
                        <div class="span2">
                            Code:</div>
                        <div class="span9">
                            @Html.TextBoxFor(x => x.Code, new { @class = "validate[required]" })</div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span2">
                            Name:</div>
                        <div class="span9">
                            @Html.TextBoxFor(x => x.Name, new { @class = "validate[required]" })</div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span2">
                            Image :</div>
                        <div class="span8">
                            <input id="fileuploadproduct" type="file" name="file" />
                            @if (Model != null && Model.Image != null && Model.Image != "")
                            {
                                <div id="imageproduct">
                                    <img src="@Url.Content("~/Media/Product/" + Model.Image)" width="70px" height="70px" alt="@Model.Image" />
                                </div>
                          
                            }
                            else
                            {
                                <div id="imageproduct">
                                </div>
                            }
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span2">
                            Short description</div>
                        <div class="span9">
                            @Html.TextAreaFor(x => x.ShortDescription, new { @cols = "10", @rows = "10" })</div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span2">
                            Full description</div>
                        <div class="span9">
                            @Html.TextAreaFor(x => x.FullDescription, new { @cols = "10", @rows = "10" })</div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span2">
                            Category</div>
                        <div class="span9">
                            @Html.DropDownListFor(x => x.CateID, Model.ListCategoryExt, new { @class = "validate[required]" })</div>
                        <div class="clear">
                        </div>
                    </div>
                  
                    <div class="row-form">
                        <div class="span2">
                            Old Price (USD):</div>
                        <div class="span9">
                            @Html.TextBoxFor(x => x.OldPrice, new { @class = "validate[required,custom[integer]]" })</div>
                        <div class="clear">
                        </div>
                    </div>
                     <div class="row-form">
                        <div class="span2">
                            New Price (USD):</div>
                        <div class="span9">
                            @Html.TextBoxFor(x => x.Price, new { @class = "validate[required,custom[integer]]" })</div>
                        <div class="clear">
                        </div>
                    </div>
                     <div class="row-form">
                        <div class="span2">
                            Start date:</div>
                        <div class="span9">
                            @Html.TextBoxFor(x => x.StartDate)</div>
                        <div class="clear">
                        </div>
                    </div>
                     <div class="row-form">
                        <div class="span2">
                            End date:</div>
                        <div class="span9">
                            @Html.TextBoxFor(x => x.EndDate)</div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span2">
                            In stock:</div>
                        <div class="span9">
                            @Html.TextBoxFor(x => x.Instock, new { @class = "validate[required,custom[integer]]" })</div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span2">
                            Is New:</div>
                        <div class="span9">
                            @Html.CheckBoxFor(x => x.New)</div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span2">
                            Is Typical:</div>
                        <div class="span9">
                            @Html.CheckBoxFor(x => x.Typical)</div>
                        <div class="clear">
                        </div>
                    </div>
                    
                   
                    <div class="row-form">
                        <div class="span2">
                            Active :</div>
                        <div class="span9">
                            @Html.CheckBoxFor(x => x.Active)</div>
                        <div class="clear">
                        </div>
                    </div>
                     <div class="row-form">
                        <div class="span2">
                            Send notify to client :</div>
                        <div class="span9">
                            @Html.CheckBoxFor(x => x.IsSendMailExt)</div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span2">
                            Select mail template :</div>
                        <div class="span9">
                            @Html.DropDownListFor(x => x.EmailTemplateIDExt,Model.ListEmailTemplateExt)</div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span11">
                            <a class="btn btn-success span3" id="popup_4">Add attribute</a>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                       @if (Helper.SessionManagement.Value("pvalue").Contains("U") || Helper.SessionManagement.Value("pvalue").Contains("C"))
                       {
                    <div class="row-form">
                        <div class="span2">
                        </div>
                        <div class="span9">
                            <input type="submit" class="btn btn-info span3" value="Update" /></div>
                        <div class="clear">
                        </div>
                    </div>
                       }
                </div>
            
                <div id="tabs-2">
                    
                    <div class="row-form">
                        <div class="span2">
                            Meta Title :</div>
                        <div class="span9">
                            @Html.TextAreaFor(x => x.MetaTitle)</div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span2">
                            Meta Keyword :</div>
                        <div class="span9">
                            @Html.TextAreaFor(x => x.MetaKeyword)</div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span2">
                            Meta Description :</div>
                        <div class="span9">
                            @Html.TextAreaFor(x => x.MetaDescription)</div>
                        <div class="clear">
                        </div>
                    </div>
                       @if (Helper.SessionManagement.Value("pvalue").Contains("U") || Helper.SessionManagement.Value("pvalue").Contains("C"))
                       {
                    <div class="row-form">
                        <div class="span2">
                        </div>
                        <div class="span9">
                            <input type="submit" class="btn btn-info span3" value="Update" /></div>
                        <div class="clear">
                        </div>
                    </div>
                       }
                </div>
                 
            }
        </div>
    </div>
</div>

<div class="dialog" id="b_popup_4" style="display: none;" title="Attribute">
    <div class="row-fluid">
        <div class="span12">
            @Html.Action("_AddOrUpdate", "ProductAttributeManagement")
            <div class="block-fluid table-sorting">
               <div class="listproductattribute">
                @Html.Action("_ShowAll", "ProductAttributeManagement", new { productid = Model.ID })
             </div>
                <div class="clear">
                </div>
            </div>
        </div>
    </div>
</div>
